package com.financial.service.platbalancepay.controller;

import com.financial.service.platbalancepay.service.BalancePayService;
import com.financial.service.platbalancepay.service.OperBalanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 平台余额支付回执信息表
 * 
 * @author zhaopengjun
 * @email 1428939700@qq.com
 * @date 2019-08-16 23:16:32
 */
 
@RestController
@RequestMapping("/platbalancePay")
public class BalancePayController {

	@Autowired
    private BalancePayService balancePayService;
	@Autowired
    private OperBalanceService operBalanceService;


	@Deprecated
	@PostMapping("/ysWechatBalancePay")
	public Map<String,Object> ysWechatBalancePay(@RequestParam Map<String,Object> paramMap){
		return balancePayService.ysWechatBalancePay(paramMap);
	}

	/**
	 * @Author zhaopengjun
	 * @Description 银盛支付异步回执
	 * @Date 16:56 2019/5/21
	 * @Param
	 * @return
	 **/
	@PostMapping("/ysWechatBalancePayCallBack")
	public String ysWechatBalancePayCallBack(@RequestParam Map<String,String> paramMap, HttpServletResponse response) {
        return balancePayService.balancePayCallBack(paramMap, response);

	}

	
	/**
	 * @Author zhaopengjun
	 * @Description //余额支付（不走营销账户）
	 * @Date 14:21 2019/8/28
	 * @Param 
	 * @return 
	 **/
	@PostMapping("/wechatBalancePay")
	public Map<String,Object> wechatBalancePay(@RequestParam Map<String,Object> reqMap){

		return balancePayService.wechatBalancePay(reqMap);
	}

	/**
	 * @Author zhaopengjun
	 * @Description //余额支付异步回执
	 * @Date 14:21 2019/8/28
	 * @Param
	 * @return
	 **/
	@PostMapping("/wechatBalanceasynPay")
	public Map<String,Object> wechatBalanceasynPay(@RequestParam Map<String,Object> reqMap){

		return balancePayService.wechatBalanceasynPay(reqMap);
	}
	/**
	 * 主动查询预支付
	 */
	@PostMapping("/queryBalancepay")
	public String queryBalancepay(@RequestParam Map<String,Object> paraMap){

		return balancePayService.queryBalancepay(paraMap);
	}
}
